{% extends 'starter.html' %}
{% block title %}
    <h1>客户信息展示</h1>
{% endblock %}
{% block content %}
    <a href="{% url 'add_customers' %}" class="btn btn-primary">添加客户</a>
    <form class="form-inline">
        <select name="search_field" id="search_field" class="form-control">
            <option value="qq__contains">qq</option>
            <option value="name__contains">name</option>
        </select>
  <div class="form-group">
    <input type="text" class="form-control" id="key_word" placeholder="请输入搜索内容" name="kw">
  </div>
    <button type="submit" class="btn btn-default">搜索</button>
   </form>
    <table class="table table-striped table-hover table-bordered">
    <thead>
    <tr>
        <th>序号</th>
        <th>qq</th>
        <th>姓名</th>
        <th>性别</th>
        <th>转介绍学员</th>
        <th>报名状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
        {% for customer_obj in customer_objs %}
        <tr>
            <td>{{ forloop.counter }}</td>
            <td>{{ customer_obj.qq }}</td>
            <td>{{ customer_obj.name }}</td>
            <td>{{ customer_obj.get_sex_display }}</td>
            <td>{{ customer_obj.introduce_from }}</td>
            <td>{{ customer_obj.status_show }}</td>
            <td>
                <a href="{% url 'edit_customers' customer_obj.id %}"><i class="fa fa-edit"></i>编辑</a>
            </td>
        </tr>

        {% endfor %}
    </tbody>
    </table>

{#    {{ page_html|safe }}#}
    {{ page_html }}

{% endblock %}